import dbElements from './db.data';
import FormComponent from '../form/Form';
import DBData from './db.data';
const formData = { schema: { components: DBData } };

export default class DBComponent extends FormComponent {
  constructor(...args) {
    super(...args);
    this.type = 'db';
  }

  static schema(...extend) {
    const schema = FormComponent.schema(
      {
        type: 'dbform',
        label: 'DB',
        key: 'dbform'
      },
      ...extend,
    );
    return schema;
  }

  static get builderInfo() {
    return {
      title: 'dbform',
      icon: '',
      group: 'custom',
      // documentation: '/userguide/#editgrid',
      weight: 1,
      schema: DBComponent.schema(),
    };
  }

  // 覆盖掉 init 方法
  init () {
    super.init();
    this.formObj = {
      display: this.component.display,
      settings: this.component.settings,
      components: this.component.components,
    };
    this.valueChanged = false;
    this.subForm = null;
    this.formSrc = '';
  }

  

  // get inputInfo() {
  //   const info = super.elementInfo();
  //   // info.type = 'select';
  //   info.changeEvent = 'change';
  //   return info;
  // }
}